package com.youku.ast;

public class ClassBlockAst extends Ast {

	public ClassBlockAst() {
		super();
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder("{");

		for (Ast ast : children()) {
			if (ast instanceof AssignAst) {
				builder.append("define var:" + ast);
			} else if (ast instanceof DefFunctionAst) {
				builder.append("define function:" + ast);
			} else {
				throw new RuntimeException("类代码块中不存在这种类型的树节点" + ast);
			}
		}

		return builder.append("}").toString();
	}

}
